package
{
	import mx.collections.ArrayCollection;
	import mx.collections.Sort;
	import mx.collections.SortField;
	
	[Bindable]
	public class Model
	{
		public var records:ArrayCollection = new ArrayCollection();
		
		public function Model()
		{
			// 並び替え方を定義する
			var sortField:SortField = new SortField();	
			sortField.name = "time";
			sortField.numeric = true;
			
			var sort:Sort = new Sort();
			sort.fields = [sortField];
			
			this.records.sort = sort;
			
			// ダミーデータ
			var record:Record = new Record();
			record.name = "マインスイーパー(ダミー)";
			record.time = "9.68";
			this.records.addItem(record);
		}
		
		public function add(record:Record):void {
			this.records.addItem(record);
			this.records.refresh();
		}
	}
}
